import json
def get_id():
    dic = {}
    for index in range(1, 96):
        with open(f'./school_id/{index}.json', 'r', encoding='utf-8') as f:
            data = f.read()
            data = json.loads(data)
        for d in data:
            dic[d['name']] = d['school_id']
        print(f"完成{index}个")
    return dic


if __name__ == '__main__':
    dic = get_id()
    with open('school_name_id.json', 'w', encoding='utf-8') as f:
        json.dump(dic, f, indent=4, ensure_ascii=False)
